package main

type WorkerLoadAvg struct {
	Id         int               `json:"id"`
	WorkerIp   string            `json:"workerIp"`
	CPULoad    string            `json:"cpuLoad"`
	FreeMemery string            `json:"freeMemery"`
	LoadAvg    string            `json:"loadAvg"`
	CreateTime uint64            `json:"createTime"`
	JobStatus  map[string]string `json:"jobStatus"`
}

func GetWorkerLoadAvg() *WorkerLoadAvg {
	workload := &WorkerLoadAvg{}
	/*vm, err := mem.VirtualMemory()
	if err != nil {
		log.Errorf("get VirtualMemory error: %s", err.Error())
	}
	loadavg, err := load.Avg()
	if err != nil {
		log.Errorf("get avg load error: %s", err.Error())
	}
	cpuload, err := cpu.Percent(time.Second*1, false)
	if err != nil {
		log.Errorf("get cpu load error: %s", err.Error())
	}
	createTime := uint64(time.Now().Unix())
	workload.FreeMemery = strconv.FormatUint(vm.Free, 10)
	workload.LoadAvg = strconv.FormatFloat(loadavg.Load1, 'f', 5, 64)
	workload.CPULoad = strconv.FormatFloat(cpuload[0], 'f', 5, 64)
	workload.CreateTime = createTime*/
	return workload
}
